package com.lilei.serialize.standard;

import com.lilei.serialize.User;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

/**
 * @Desc
 * @Auther 李雷(KyLin)
 * @Date 2020/03/31
 */
public class Client {

    public static void main(String[] args) {
        try {
            Socket socket = new Socket("localhost", 8080);

            User user = new User("lilei", 2, 28);
            ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
            out.writeObject(user);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
